package com.tyl.xtk.exception;

import com.tyl.xtk.constants.ErrorEnum;
import lombok.Getter;
import lombok.Setter;

/**
 * create by tyl at 2025/8/27
 */

public class ServiceException extends RuntimeException {
    @Setter
    @Getter
    private int code;

    public ServiceException(int code, String message) {
        super(message);
        this.code = code;
    }

    public ServiceException(String message) {
        super(message);
        this.code = ErrorEnum.Common.getCode();
    }
}
